package com.java.shop.ware.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.java.common.to.OrderTo;
import com.java.common.to.SkuHasStockTo;
import com.java.common.to.WareSkuLockTo;
import com.java.common.to.mq.StockLockedTo;
import com.java.common.utils.PageUtils;
import com.java.shop.ware.entity.WareSkuEntity;
import com.java.shop.ware.exception.NoStockException;
import com.java.shop.ware.vo.ProductToWareVo;

import java.util.List;
import java.util.Map;

/**
 * 商品库存
 *
 * @author cxq
 * @email 137512476@qq.com
 * @date 2021-04-22 18:22:16
 */
public interface WareSkuService extends IService<WareSkuEntity> {

    PageUtils queryPage(Map<String, Object> params);

    PageUtils queryPageCondition(Map<String, Object> params);

    void addStock(ProductToWareVo wareVo);

    List<SkuHasStockTo> hasStock(List<Long> skuIds);

    Boolean orderLockStock(WareSkuLockTo to) throws NoStockException;

    void unLockStock(StockLockedTo to);

    void unLockStock(OrderTo to);
}

